﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OA.Service.Model.Data;

namespace OA.SSO.Lib
{
    public abstract class LoginIHttpHandler:IHttpHandler,System.Web.SessionState.IRequiresSessionState
    {

        /// <summary>
        /// 当前登陆用户
        /// </summary>
        public static User LoginUser { get { return LoginPage.LoginUser; } set { LoginPage.LoginUser = value; } }

        HttpContext Context = null;
        HttpResponse Response = null;
        HttpRequest Request = null;
        System.Web.SessionState.HttpSessionState Session = null;
        HttpServerUtility Server = null;
        HttpApplicationState Application = null;

        public void ProcessRequest(HttpContext context)
        {
            Context = context;
            Response = context.Response;
            Request = context.Request;
            Session = context.Session;
            Server = context.Server;
            Application = context.Application;
            LoginPage.ValidateLogin();
            ProcessRequest();
        }

        /// <summary>
        /// 处理请求
        /// </summary>
        public abstract void ProcessRequest();

        public abstract bool IsReusable{get;}
    }
}
